//
//  SettingCell.swift
//  todaySwift
//
//  Created by ChokWah on 2018/3/19.
//  Copyright © 2018年 ChokWah. All rights reserved.
//

import UIKit

class SettingCell: UITableViewCell, RegisterCellOrNib {

    @IBOutlet weak var subTitleLabelHeight: NSLayoutConstraint!
    @IBOutlet weak var bottomLine: UIView!
    @IBOutlet weak var switchView: UISwitch!
    @IBOutlet weak var titleLabel: UILabel!
    @IBOutlet weak var subTitleLabel: UILabel!
    @IBOutlet weak var rightLabel: UILabel!
    @IBOutlet weak var arrawImageView: UIImageView!
    var setting: SettingModel? {
        didSet {
            titleLabel.text = setting!.title
            subTitleLabel.text = setting!.subtitle
            rightLabel.text = setting!.rightTitle
            arrawImageView.isHidden = setting!.isHiddenRightArraw
            switchView.isHidden = setting!.isHiddenSwitch
            if !setting!.isHiddenSubtitle {
                subTitleLabelHeight.constant = 20
                layoutIfNeeded()
            }
        }
    }
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
